package com.eatpoint.plugins;

import org.json.JSONException;
import org.json.JSONObject;

public class UserEntity {


    /**
     * age : 99
     * source : XXXX
     * modelName : XXXX
     * createdTime : 2020-05-19
     * customerName : XXXX
     * gender : 男
     * intentLevel : c级
     * mobilePhone : 13888888888
     * seriesName : XXXX
     * potentialCustomersId : 32322
     * varietyName : XX
     * consultantName : FFFFF
     */

    private int age;
    private String source;
    private String modelName;
    private String createdTime;
    private String customerName;
    private String gender;
    private String intentLevel;
    private String mobilePhone;
    private String seriesName;
    private int potentialCustomersId;
    private String varietyName;
    private String consultantName;

    public UserEntity() {
    }

    public UserEntity(String json) {
        try {
            JSONObject jsonObject = new JSONObject(json);
            if (jsonObject.has("customerName")) customerName = jsonObject.getString("customerName");
            if (jsonObject.has("mobilePhone")) mobilePhone = jsonObject.getString("mobilePhone");
            if (jsonObject.has("age")) age = jsonObject.getInt("age");
            if (jsonObject.has("gender")) gender = jsonObject.getString("gender");
            if (jsonObject.has("intentLevel")) intentLevel = jsonObject.getString("intentLevel");
            if (jsonObject.has("modelName")) modelName = jsonObject.getString("modelName");
            if (jsonObject.has("consultantName")) consultantName = jsonObject.getString("consultantName");
            if (jsonObject.has("source")) source = jsonObject.getString("source");
            if (jsonObject.has("createdTime")) createdTime = jsonObject.getString("createdTime");
        } catch (JSONException e) {
            e.printStackTrace();
        }
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getSource() {
        return source;
    }

    public void setSource(String source) {
        this.source = source;
    }

    public String getModelName() {
        return modelName;
    }

    public void setModelName(String modelName) {
        this.modelName = modelName;
    }

    public String getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(String createdTime) {
        this.createdTime = createdTime;
    }

    public String getCustomerName() {
        return customerName;
    }

    public void setCustomerName(String customerName) {
        this.customerName = customerName;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getIntentLevel() {
        return intentLevel;
    }

    public void setIntentLevel(String intentLevel) {
        this.intentLevel = intentLevel;
    }

    public String getMobilePhone() {
        return mobilePhone;
    }

    public void setMobilePhone(String mobilePhone) {
        this.mobilePhone = mobilePhone;
    }

    public String getSeriesName() {
        return seriesName;
    }

    public void setSeriesName(String seriesName) {
        this.seriesName = seriesName;
    }

    public int getPotentialCustomersId() {
        return potentialCustomersId;
    }

    public void setPotentialCustomersId(int potentialCustomersId) {
        this.potentialCustomersId = potentialCustomersId;
    }

    public String getVarietyName() {
        return varietyName;
    }

    public void setVarietyName(String varietyName) {
        this.varietyName = varietyName;
    }

    public String getConsultantName() {
        return consultantName;
    }

    public void setConsultantName(String consultantName) {
        this.consultantName = consultantName;
    }
}
